import java.util.ArrayList;
import java.util.List;

public class College {
    private List<Building> buildings;
    private List<Course> courses;

    public College() {
        buildings = new ArrayList<>();
        courses = new ArrayList<>();
    }

    // 添加Building方法
    public void addBuilding(Building building) {
        buildings.add(building);
    }

    // 添加Course方法
    public void addCourse(Course course) {
        // 检查课程是否在某个建筑中进行
        if (course.getBuilding() != null) {
            courses.add(course);
        } else {
            System.out.println("每个Course必须在某个Building中进行");
        }
    }

    public List<Building> getBuildings() {
        return buildings;
    }

    public List<Course> getCourses() {
        return courses;
    }
}
